package com.jumi.microservice.dto.order;

import com.jumi.microservice.common.enumeration.ArgumentResponseEnum;
import com.jumi.microservice.common.exception.BaseException;
import com.jumi.microservice.common.page.PageDomain;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.util.StringUtils;

/**
 * @author Dirk
 * @Date 2020-08-07 13:45
 */
public class OrderInfoRequest extends PageDomain {
    private static final long serialVersionUID = 1059155185182918222L;
    @ApiModelProperty("订单id")
    private Integer orderId;

    @ApiModelProperty("订单编号")
    private String orderSn;

    @ApiModelProperty(hidden = true)
    private Long uid;

    @ApiModelProperty("订单类型, 全部传null")
    private Byte orderStatus;

    @ApiModelProperty("搜索关键词")
    private String searchKeyword;

    @Override
    public void checkRequest() {
        if (StringUtils.isEmpty(orderSn)) {
            throw new BaseException(ArgumentResponseEnum.VALID_ERROR);
        }
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public Byte getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Byte orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getSearchKeyword() {
        return searchKeyword;
    }

    public void setSearchKeyword(String searchKeyword) {
        this.searchKeyword = searchKeyword;
    }
}
